#ifndef WOLF_TRUE_TYPE_FONT_TEST_HPP
#define WOLF_TRUE_TYPE_FONT_TEST_HPP

#include "StdTest.hpp"
#include "TrueTypeFont.hpp"

namespace wolf
{
    /**
     * @brief Tests the true type font
     *
     *
     **/
    class TrueTypeFontTest: public StdTest
    {
    public:
        TrueTypeFontTest( void ): StdTest( "True Type Font" )
        {

        }
        virtual ~TrueTypeFontTest( void )
        {
            cout << "ByeBye" << endl;
        }

        class MyEventHandler: public Manager
        {
        public:
            TTF_Font *_font;
            TrueTypeFont _font2;
            MyEventHandler(TTF_Font* font): _font2(font, false)
            {
                _font = font;
            }
            void onDraw( Engine &engine, SDL_Surface* dst )
            {
                SDL_Surface *text =  TTF_RenderUTF8_Solid( _font, "Olá, sou um texto", Color( 51, 8, 251 ).toSDL_Color() );
                SDL_BlitSurface( text, NULL, engine.getScreen(), NULL );

                _font2.writeText("Olá, eu sou um texto", dst, 0, 100, Color(125,99,22));
            }
        } ;

        bool run( Engine &engine )
        {
            MyEventHandler myHandler(_font);
//            MyEventHandler eventHandler( font );
            engine.addManager( myHandler );
            while( engine.isRunning() )
            {
                engine.doFrame();
            }
            return true;
        }
    protected:

    private:

    };

}

#endif // WOLF_TRUE_TYPE_FONT_TEST_HPP

